using System;
using Castle.ActiveRecord;

namespace CosyTrade.Organization
{
    [Serializable, ActiveRecord("CompanyRelation")]
    public class CompanyRelation
    {
        private Guid primaryKey = Guid.NewGuid();
        private Company masterCompany;
        private Company childCompany;

        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID", Access=PropertyAccess.NosetterCamelcase)]
        public Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        [BelongsTo("MasterCompanyGuid")]
        public Company MasterCompany
        {
            get { return masterCompany; }
            set { masterCompany = value; }
        }

        [BelongsTo("ChildCompanyGuid")]
        public Company ChildCompany
        {
            get { return childCompany; }
            set { childCompany = value; }
        }
    }
}